package com.easyarlibrary.util;

import android.util.Log;

/**
 * createTime：2019/2/26/026 on 11:47
 *
 * @author: jyc dell
 */
public class LogUtil {

    private static final boolean showLog = true;
    private static final String TAG = "LogUtil--->";

    public static void d(String msg){
        if(!showLog){
            return;
        }
        //  把4*1024的MAX字节打印长度改为2001字符数
        int max_str_length = 2001 - TAG.length();
        //大于4000时
        while (msg.length() > max_str_length) {
            Log.i(TAG, msg.substring(0, max_str_length));
            msg = msg.substring(max_str_length);
        }
        Log.d(TAG,msg);
    }

    public static void info(String msg){
        if(!showLog){
            return;
        }
        //  把4*1024的MAX字节打印长度改为2001字符数
        int max_str_length = 2001 - TAG.length();
        //大于4000时
        while (msg.length() > max_str_length) {
            Log.i(TAG, msg.substring(0, max_str_length));
            msg = msg.substring(max_str_length);
        }
        Log.i(TAG,msg);
    }
}
